home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / ins_msc / imc9106 / stopwatc.h < prev    next >
Text File  |  1991-05-09  |  2KB  |  41 lines

  1. /*********************************************************************
  2. * STOPWATC.H - This file contains the typedef's, extern's, #define's *
  3. *     and prototypes needed to interface with the high-resolution    *
  4. *     timer functions.                                               *
  5. *********************************************************************/
  6.  
  7. typedef unsigned char UCHAR;      /* Remove if you include OS2DEF.H */
  8. typedef unsigned int  UINT;       /* Remove if you include OS2DEF.H */
  9. typedef unsigned long ULONG;      /* Remove if you include OS2DEF.H */
  10.  
  11. typedef struct {
  12.     UINT  TimerOverhead;          /* Avg. HRTimer overhead          */
  13.     UINT  TickerOverhead;         /* Avg. BIOS ticker overhead      */
  14.     UINT  StartCounter;           /* Starting value of PIT counter 0*/
  15.     UINT  StopCounter;            /* Ending value of PIT counter 0  */
  16.     ULONG StartTicker;            /* Start val of master clock count*/
  17.     ULONG StopTicker;             /* End value of master clock count*/
  18.     ULONG StartTime;              /* Relative starting time         */
  19.     ULONG StopTime;               /* Relative ending time           */
  20.     ULONG Interval;               /* Interval calc'd by StopWatch() */
  21.     ULONG NumTicks;               /* Number of ticks during interval*/
  22.     } HRstruct;
  23.  
  24. extern HRstruct HR;               /* Global struct with timer data  */
  25.  
  26. /*-------- Manifest constants used in StopWatch() processing--------*/
  27. #define COUNTS_PER_SEC  (double)1193180
  28. #define COUNTS_PER_mSEC (double)1193.18
  29. #define COUNTS_PER_uSEC (double)1.19318
  30. #define START 1                   /* Argument for StopWatch()       */
  31. #define STOP  2                   /* Argument for StopWatch()       */
  32. #define StartTimer() StopWatch( START )
  33. #define StopTimer()  StopWatch( STOP )
  34. #define CODETIME 1                /* Argument for HRInit()          */
  35. #define REALTIME 2                /* Argument for HRInit()          */
  36.  
  37. /*-------- Function prototypes -------------------------------------*/
  38. void HRInit( int Mode );
  39. void HRTerm( void );
  40. ULONG StopWatch( int Flag );
  41.